package moodish.dummy;

import static org.junit.Assert.*;
import moodish.comm.ServerSideMessage.Type;

import org.junit.AfterClass;
import org.junit.Test;

public class MessageFromServerTest {


	@Test
	public void testMessageFromServer() {
		MessageFromServer msg = new MessageFromServer(null, null, null, null);
		assertNotNull(msg);
	}

	@Test
	public void testMessageFromServer2() {
		MessageFromServer msg = new MessageFromServer("luis", null, null, null);
		String a = "luis";
		assertSame(msg.getSendersNickname(), a);
	}
	
	@Test
	public void testPaylouad(){
		MessageFromServer msg = new MessageFromServer(null, "hello luis", null, moodish.comm.ClientSideMessage.Type.MOODISH_MESSAGE);
		String a = "hello luis";
		assertSame(msg.getPayload(), a);
	}
	
	@Test
	public void testPaylouad1(){
		MessageFromServer msg = new MessageFromServer(null, "hello luis", null, null);
		
		assertSame(null, msg.getType());
	}
	
	@Test
	public void testType(){
		MessageFromServer msg = new MessageFromServer(null, null, null, moodish.comm.ClientSideMessage.Type.FRIENDSHIP);
		MessageFromServer msg1 = new MessageFromServer(null, null, null, moodish.comm.ClientSideMessage.Type.FRIENDSHIP);
		assertSame(msg.getType(), msg1.getType());
	}
}
